import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

import Exam from '../views/Exam.vue'

import Ghoa from '../views/Ghoa.vue'

Vue.use(VueRouter)

console.log("process.env.VUE_APP_CUSTOMIZE",process.env.VUE_APP_CUSTOMIZE,process.env)

let homeRoute={};


if(process.env.VUE_APP_CUSTOMIZE=='ex'){
  homeRoute={
    path: '/',
    name: 'exam',
    component: Exam
  }
}

if(process.env.VUE_APP_CUSTOMIZE=='oa'){
  homeRoute={
    path: '/',
    name: 'ghoa',
    component: Ghoa
  };
}


const routes = [
  // {
  //   path: '/',
  //   name: 'home',
  //   component: HomeView
  // },
  homeRoute,
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
